package com.lei.chinese_herbal_medicine.Service.Impl;

import com.lei.chinese_herbal_medicine.Entity.PageData;
import com.lei.chinese_herbal_medicine.Entity.TrainDataset;
import com.lei.chinese_herbal_medicine.Mapper.TrainDatasetMapper;
import com.lei.chinese_herbal_medicine.Service.TrainDatasetService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * (TrainDataset)表服务实现类
 *
 * @author makejava
 * @since 2024-01-18 10:06:42
 */
@Service("trainDatasetService")
public class TrainDatasetServiceImpl implements TrainDatasetService {
    @Resource
    private TrainDatasetMapper trainDatasetMapper;

    @Override
    public boolean insert(TrainDataset record) {
        return trainDatasetMapper.insert(record)==1;
    }

    @Override
    public List<TrainDataset> selectTrainDatasetByHerbId(String herbId, PageData pageData) {
        List<TrainDataset> trainDatasets=trainDatasetMapper.selectTrainDatasetByHerbIdWithBLOBs(herbId,pageData);
        pageData.setCount(trainDatasetMapper.selectTrainDatasetCount(herbId));
        return trainDatasets;
    }

    @Override
    public boolean deleteByPrimaryKey(String id) {
        return trainDatasetMapper.deleteByPrimaryKey(id)==1;
    }

}


